package com.keensense.vcm.model;

import com.keensense.vcm.model.enums.CredentialTypeEnum;
import com.keensense.vcm.model.enums.GenderEnum;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
 * @author lanjian
 * @date 2020/7/27
 */
@XmlRootElement(name = "response")
public class GetPeoplesResponse extends BaseResponse{


    @XmlElement
    private Integer total;

    @XmlElementWrapper(name = "peoples")
    @XmlElement(name = "people")
    private List<People> peoples;

    private List<AlgorithmResult> algorithmResults;

    @XmlTransient
    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    @XmlTransient
    public List<People> getPeoples() {
        return peoples;
    }

    public void setPeoples(List<People> peoples) {
        this.peoples = peoples;
    }

    @XmlElementWrapper(name = "algorithmResults")
    @XmlElement(name = "algorithmResult")
    public List<AlgorithmResult> getAlgorithmResults() {
        return algorithmResults;
    }

    public void setAlgorithmResults(List<AlgorithmResult> algorithmResults) {
        this.algorithmResults = algorithmResults;
    }

    public static class People {
        /**
         * 出生日期，2015-09-25
         */
        @XmlElement
        private String bornTime;

        /**
         * 创建时间
         */
        @XmlElement
        private Long creatTime;

        /**
         * 人员id
         * 范围：0-9A-Fa-f，长度24
         */
        @XmlElement
        private String id;

        /**
         * 国籍
         * 中文、英文、数字和.空格，长度[1,255]
         */
        @XmlElement
        private String country;

        /**
         * 证件号码
         * 英文、数字、()，长度[1,255]
         */
        @XmlElement
        private String credentialNumber;

        /**
         * 证件类型
         */
        @XmlElement
        private CredentialTypeEnum credentialType;

        /**
         * 描述信息
         */
        @XmlElement
        private String description;

        /**
         * 性别
         */
        @XmlElement
        private GenderEnum gender;

        /**
         * 姓名
         * 中文、英文、数字和 .·-空格，首位不为特殊字符，长度[1,255]
         */
        @XmlElement
        private String name;

        /**
         * 民族
         */
        @XmlElement
        private String nationality;

        /**
         * 职业
         */
        @XmlElement
        private String occupation;

        @XmlElement
        private String tag;
        /**
         * 户籍所在地
         */
        @XmlElement
        private String domicile;

        /**
         * 当前居住地
         */
        @XmlElement
        private String presentPlace;

        /**
         * 库id
         */
        @XmlElement
        private String libraryId;

        /**
         * 人员的图片，最多五张图片
         */
        @XmlElementWrapper(name = "pictures")
        @XmlElement(name = "picture")
        private List<Picture> pictures;


        @XmlTransient
        public String getBornTime() {
            return bornTime;
        }

        public void setBornTime(String bornTime) {
            this.bornTime = bornTime;
        }

        @XmlTransient
        public Long getCreatTime() {
            return creatTime;
        }

        public void setCreatTime(Long creatTime) {
            this.creatTime = creatTime;
        }

        @XmlTransient
        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @XmlTransient
        public String getCountry() {
            return country;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        @XmlTransient
        public String getCredentialNumber() {
            return credentialNumber;
        }

        public void setCredentialNumber(String credentialNumber) {
            this.credentialNumber = credentialNumber;
        }

        @XmlTransient
        public CredentialTypeEnum getCredentialType() {
            return credentialType;
        }

        public void setCredentialType(CredentialTypeEnum credentialType) {
            this.credentialType = credentialType;
        }

        @XmlTransient
        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        @XmlTransient
        public GenderEnum getGender() {
            return gender;
        }

        public void setGender(GenderEnum gender) {
            this.gender = gender;
        }

        @XmlTransient
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @XmlTransient
        public String getNationality() {
            return nationality;
        }

        public void setNationality(String nationality) {
            this.nationality = nationality;
        }

        @XmlTransient
        public String getOccupation() {
            return occupation;
        }

        public void setOccupation(String occupation) {
            this.occupation = occupation;
        }

        @XmlTransient
        public String getTag() {
            return tag;
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        @XmlTransient
        public String getDomicile() {
            return domicile;
        }

        public void setDomicile(String domicile) {
            this.domicile = domicile;
        }

        @XmlTransient
        public String getPresentPlace() {
            return presentPlace;
        }

        public void setPresentPlace(String presentPlace) {
            this.presentPlace = presentPlace;
        }

        @XmlTransient
        public String getLibraryId() {
            return libraryId;
        }

        public void setLibraryId(String libraryId) {
            this.libraryId = libraryId;
        }

        @XmlTransient
        public List<Picture> getPictures() {
            return pictures;
        }

        public void setPictures(List<Picture> pictures) {
            this.pictures = pictures;
        }
    }

    public static class Picture {

        @XmlElement
        private String thirdId;

        @XmlElement
        private String fileId;

        /**
         * 图片下载url，通过https协议访问，要支持tls1.1和1.2的加密协议；如果通过token鉴权访问url，有效期为20-30分钟
         */
        @XmlElement
        private String url;

        private List<Feature> featureList;

        @XmlTransient
        public String getThirdId() {
            return thirdId;
        }

        public void setThirdId(String thirdId) {
            this.thirdId = thirdId;
        }

        @XmlTransient
        public String getFileId() {
            return fileId;
        }

        public void setFileId(String fileId) {
            this.fileId = fileId;
        }

        @XmlTransient
        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        @XmlElementWrapper(name = "featureList")
        @XmlElement(name = "feature")
        public List<Feature> getFeatureList() {
            return featureList;
        }

        public void setFeatureList(List<Feature> featureList) {
            this.featureList = featureList;
        }
    }

    public static class AlgorithmResult {

        private Integer total;

        private Integer srcQuality;

        private List<People> peoples;

        @XmlElement
        public Integer getTotal() {
            return total;
        }

        public void setTotal(Integer total) {
            this.total = total;
        }

        @XmlElement
        public Integer getSrcQuality() {
            return srcQuality;
        }

        public void setSrcQuality(Integer srcQuality) {
            this.srcQuality = srcQuality;
        }

        @XmlElementWrapper(name = "peoples")
        @XmlElement(name = "people")
        public List<People> getPeoples() {
            return peoples;
        }

        public void setPeoples(List<People> peoples) {
            this.peoples = peoples;
        }
    }

    public static class Feature {

        private String featureId;

        private String featureValue;

        private String userData;

        private String algorithmCode;

        private Integer quality;

        private Integer similarity;

        @XmlElement
        public String getFeatureId() {
            return featureId;
        }

        public void setFeatureId(String featureId) {
            this.featureId = featureId;
        }

        @XmlElement
        public String getFeatureValue() {
            return featureValue;
        }

        public void setFeatureValue(String featureValue) {
            this.featureValue = featureValue;
        }

        @XmlElement
        public String getUserData() {
            return userData;
        }

        public void setUserData(String userData) {
            this.userData = userData;
        }

        @XmlElement
        public String getAlgorithmCode() {
            return algorithmCode;
        }

        public void setAlgorithmCode(String algorithmCode) {
            this.algorithmCode = algorithmCode;
        }

        @XmlElement
        public Integer getQuality() {
            return quality;
        }

        public void setQuality(Integer quality) {
            this.quality = quality;
        }

        @XmlElement
        public Integer getSimilarity() {
            return similarity;
        }

        public void setSimilarity(Integer similarity) {
            this.similarity = similarity;
        }
    }
}
